package com.epay.generator.controller;

import com.epay.generator.entity.sysUser;
import com.epay.generator.mapper.sysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName TestController
 * @Description 测试sql连接状态
 * @Author chen
 * @Date 2020/3/9 11:18
 */
@RequestMapping("test")
@Controller
public class TestController {

    @Autowired
    private sysUserMapper userMapper;


    @RequestMapping("/testsql")
    @ResponseBody
    public Map<String,Object> testSql(){
        List<sysUser> list= userMapper.selectAll();
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("data",list);
        return map;
    };
}
